﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Knlght.Web.Infrastructure;


namespace Knlght.Web.Controllers
{
    public class CommonController : Controller
    {
        public virtual ActionResult VerifyImage()
        {
            //生成验证码
            var validateCodeType = new ValidateCode_Style1();
            string code = "0000";
            byte[] bytes = validateCodeType.CreateImage(out code);
            //把验证码放入cookie中
            CookieHelper.Save("verifyCode", code, 10);
            //返回验证码图片
            return File(bytes, @"image/jpeg");
        }
    }
}